package UserProfile;

import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;

public class EntryFrame extends JFrame{
	
	JButton closeButton = new JButton("KAPAT");
	JButton updateButton = new JButton("GUNCELLE");
	String name; 
	
	public EntryFrame (String name) {
		super("GIRIS BASARILI");
		setLocationRelativeTo(null);
		setSize(300, 200);
		setResizable(false);
		
		setLayout(new GridLayout(2, 1));
		add(closeButton);
		add(updateButton);
		this.name = name;
		
		updateButton.addActionListener(new updateButtonListener());
		closeButton.addActionListener(new closeButtonListener());
	}
	
	public class updateButtonListener implements ActionListener {

		@Override
		public void actionPerformed(ActionEvent arg0) {
			UpdateUserFrame uuf = new UpdateUserFrame(name);
			uuf.setVisible(true);
			setVisible(false);
			
		}
		
	}
	
	public class closeButtonListener implements ActionListener {

		@Override
		public void actionPerformed(ActionEvent e) {
			System.exit(0);
			
		}
		
	}
}
